package com.ruicar.afs.cloud.apply.admin.manage.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.ruicar.afs.cloud.apply.admin.manage.entity.SysDepartment;

import java.util.ArrayList;
import java.util.List;

/**
 * @author: Lee
 * @date 2020-06-01 06:10:43
 * @description
 */
public interface ApplyDepartmentService extends IService<SysDepartment> {
    List<SysDepartment> findByTitle(String title);

    List<SysDepartment> channelSearch(String title, Long channelId);

    void deleteByIds(Long[] ids);

    void deleteById(Long id);

    void saveDepartment(SysDepartment department);

    void editDepartment(SysDepartment department);

    List<SysDepartment> findAllSubByParentId(Long parentId);

    void getDepartmentIds(ArrayList<Long> ids, Long oneId);

    /**
     * 根据用户名获取同级、下级的部门id
     */
    public List<String> getDeptIds(String userLoginName);

    /**
     * 部门向下递归，包括自己
     *
     * @param userLoginName
     * @return
     */
    public List<Long> getDeptIdsDownAndSelf(String userLoginName);
}
